package com.kly.user.db.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.kly.user.db.dao.IssueSupplyUserDao;
import com.kly.user.db.entity.IssueSupplyUserEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
 * User: user
 * Date: 2023-11-14
 * Time: 18:03:32.116
 */

@Repository
public class IssueSupplyUserDaoImpl extends AbstractBaseMapper<IssueSupplyUserEntity> implements IssueSupplyUserDao {

    @Override
    public int deleteNotUse() {
        return this.getSqlSession().delete(this.getStatement("deleteNotUse"));
    }

    @Override
    public int updateUseStatus() {
        return this.getSqlSession().update(this.getStatement("updateUseStatus"));
    }

    @Override
    public int updateConnectCount(String userCode) {
        Map<String, Object> selectUsersParams = new HashMap<>();
        selectUsersParams.put("userCode", userCode);
        return this.getSqlSession().update(this.getStatement("updateConnectCount"), selectUsersParams);
    }
}